package com.navigation.action;

import java.util.Map;

import com.navigation.action.base.BaseAction;
import com.navigation.model.Site;
import com.opensymphony.xwork2.ActionContext;


public class EditSiteAction extends BaseAction{
	private Integer id;
	private String name;
	private String url;
	private String alexa;
	private Site site;
	
	@Override
	public String execute() throws Exception {
		Map session=ActionContext.getContext().getSession();
		site = siteManager.findSiteById(getId());
		if (null != site) {
			setSite(site);
			return SUCCESS;
		} else {
			addActionError("暂没有添加网址！");
		}
		return "failure";
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getAlexa() {
		return alexa;
	}
	public void setAlexa(String alexa) {
		this.alexa = alexa;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}
}
